<template>
	<view class="page" :style="themeColor">
		<view class="flex align-stretch benben-position-layout flex myMoney_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">

			<view class='flex align-center justify-between flex-sub myMoney_fd0_0'>
				<view class='flex align-center myMoney_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
					data-url="1">
					<text class='fu-iconfont2  myMoney_fd0_0_c0_c0'>&#xE794;</text>
				</view>
				<view class='flex align-center'>
					<text class='myMoney_fd0_0_c1_c0'>我的钱包</text>
				</view>
				<view class='flex align-center justify-end myMoney_fd0_0_c2' @tap.stop="handleJumpDiy"
					data-type="navigateTo" :data-url="`/pages/wode/myMoney/bindAccount`">
					<text class="bind_account">绑定账号</text>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#4177DD"></u-loading>
			<view>加载中</view>
		</view>
		<view v-else>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout myMoney_flex_1">
				<view class='flex flex-direction flex-wrap align-center myMoney_fd1_0'>
					<view class="money_info">
						<view class="money_info_item">
							<view class="money_info_item_1">{{moneyInfo.user_money}}</view>
							<view class="money_info_item_2">余额（元）</view>
						</view>
					</view>
					<view class="money_info_withdraw" @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/wode/myMoney/Withdrawals`">提现</view>
				</view>
			</view>
			<!---flex布局flex布局结束-->
			<!---金额查看全部flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout myMoney_flex_2">
				<view class='flex flex-wrap align-center justify-between myMoney_fd2_0'>
					<text class='myMoney_fd2_0_c0'>近30天记录</text>
					<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/wode/myMoney/balanceDetail`">
						<text class='myMoney_fd2_0_c1_c0'>查看全部</text>
					</view>
				</view>
			</view>
			<!---金额查看全部flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout myMoney_flex_3" v-if="list.length > 0">
				<view class='flex align-center justify-between myMoney_fd3_0' v-for="(v, k) in list" :key="k">
					<view class='flex flex-direction align-stretch flex-sub myMoney_fd3_0_c0'>
						<text class='myMoney_fd3_0_c0_c0'>{{v.title}}</text>
						<text class='myMoney_fd3_0_c0_c1'>{{v.create_time}}</text>
					</view>
					<view class='flex flex-direction align-center' v-if="v.change_money > 0">
						<view class='flex flex-wrap align-center myMoney_fd3_0_c1_c0'>
							<text class='myMoney_fd3_0_c1_c0_c0'>+</text>
							<text class='myMoney_fd3_0_c1_c0_c1'>{{v.change_money}}</text>
						</view>
					</view>
					<view class='flex flex-direction align-center' v-else>
						<view class='flex flex-wrap align-center myMoney_fd3_1_c1_c0'>
							<text class='myMoney_fd3_1_c1_c0_c1'>{{v.change_money}}</text>
						</view>
					</view>
				</view>
				<view class="loadmore">
					<u-loadmore v-if="last_page > 1" font-size="24" :status="status" :icon-type="iconType"
						:load-text="loadText" />
				</view>
			</view>
			<view style="margin-top: 100rpx;" class="noData_other" v-if="list.length == 0 && !isShow">
				<image src="/static/empty/no.png"></image>
			</view>
			<!---flex布局flex布局结束-->
		</view>

		<benben-popup v-model="popupShow1661322664747" :mask="true" mode='center'>
			<!---提现规则弹窗flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout myMoney_flex_4">
				<view class='flex flex-direction align-stretch myMoney_fd4_0'>
					<view class='flex align-center justify-center myMoney_fd4_0_c0'>
						<text class='myMoney_fd4_0_c0_c0'>提现规则</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='myMoney_fd4_0_c1_c0'>通过用户端发起提现申请，后台审核通过，线下进行打款
							请您确认绑定的支付宝、微信号的准确性。后台将按照您绑定的提现账户进行进行转账。
							如因提交的信息有误导致的转账失败或转错账户，将由用户自行承担，平台不承担任何责任。</text>
					</view>
				</view>
				<view class='flex align-center justify-center myMoney_fd4_1'>
					<image class='myMoney_fd4_1_c0' mode="aspectFit" :src='STATIC_URL+"151.png"'></image>
				</view>
			</view>
			<!---提现规则弹窗flex布局结束-->
		</benben-popup>

	</view>
</template>
<script>
	export default {
		components: {},

		data() {
			return {
				"popupShow1661322664747": false,
				"userInfo": {
					"user_money": 0
				},
				"moneyInfo": {},
				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
			this.getData();
		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
		},
		// 上拉加载
		onReachBottom() {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {

				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getList();
			}, 500)
		},
		onPageScroll(e) {

		},
		methods: {
			// 获取钱包资料  post6600d56222ec6
			getData() {
				this.$api.post(global.apiUrls.post6600d56222ec6, {

				}).then(res => {
					// console.log(res);
					if (res.data.code == 1) {
						this.moneyInfo = res.data.data;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			// 30天记录  post6600d5818f076
			getList() {
				this.$api.post(global.apiUrls.post6600d5818f076, {
					page: this.page
				}).then(res => {
					console.log(res);
					uni.stopPullDownRefresh();
					this.isShow = false;
					if (res.data.code == 1) {
						this.last_page = res.data.data.last_page;
						if (this.is_pull) {
							this.list = res.data.data.data;
						} else {
							this.list = this.list.concat(res.data.data.data);
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.money_info {
		width: 100%;
		display: flex;
		justify-content: center;
		// padding: 0 72rpx;

		.money_info_item {
			text-align: center;

			.money_info_item_1 {
				color: #fff;
				font-size: 48rpx;
				font-weight: bold;
			}

			.money_info_item_2 {
				font-size: 28rpx;
				color: #fff;
				margin-top: 10rpx;
			}
		}
	}

	.money_info_withdraw {
		margin-top: 50rpx;
		width: 184rpx;
		height: 60rpx;
		line-height: 60rpx;
		text-align: center;
		color: #3083FF;
		font-weight: 500;
		background: #fff;
		font-size: 28rpx;
		border-radius: 40rpx;
	}

	.bind_account {
		color: #fff;
		font-size: 32rpx;
	}


	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		// background: rgba(248, 248, 248, 1);
		background: url(~@/static/images/161.png) no-repeat;
		background-size: 100% 446rpx !important;
	}

	.myMoney_flex_0 {
		// border-bottom: 1px solid #eee;
		background: url(~@/static/images/161.png) no-repeat;
		background-size: 100% !important;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.myMoney_fd0_0_c2 {
		width: 220rpx;
	}

	.myMoney_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #fff;
	}

	.myMoney_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #fff;
	}

	.myMoney_fd0_0_c0 {
		width: 220rpx;
	}

	.myMoney_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.myMoney_flex_1 {
		background-size: 100% !important;
		background-size: 100% auto !important;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.myMoney_fd1_0_c2 {
		background: linear-gradient(180deg, #FFFFFF 0%, #FFF4D9 52%, #FFFFFF 100%);
		background-size: 100% !important;
		border-radius: 30rpx 30rpx 30rpx 30rpx;
		font-size: 32rpx;
		color: rgba(124, 60, 47, 1);
		width: 220rpx;
		height: 60rpx;
		box-shadow: 0rpx 3rpx 6rpx 1rpx #D5B07F, inset 0rpx 3rpx 6rpx 1rpx #FFFFFF;
		line-height: 60rpx;
	}

	.myMoney_fd1_0_c1 {
		color: #9A5614;
		font-size: 24rpx;
		font-weight: 500;
		margin: 12rpx 0rpx 40rpx 0rpx;
	}

	.myMoney_fd1_0_c0 {
		color: #9A5614;
		font-size: 64rpx;
		font-weight: 700;
	}

	.myMoney_fd1_0 {
		border-radius: 16rpx;
		background-size: 100% auto !important;
		padding: 54rpx 0 32rpx;
	}

	.myMoney_flex_2 {
		background: #EAF2FF;
		background-size: 100% !important;
		padding: 0rpx 24rpx 0rpx 32rpx;
		background-size: 100% auto !important;
	}

	.myMoney_fd2_0_c1_c0 {
		font-size: 28rpx;
		font-weight: 700;
		color: #3083FF;
	}

	.myMoney_fd2_0_c0 {
		font-size: 28rpx;
		font-weight: 700;
		color: #3083FF;
	}

	.myMoney_fd2_0 {
		padding: 16rpx 0rpx 16rpx 0rpx;
	}

	.myMoney_flex_3 {
		background: #fff;
		background-size: 100% !important;
		padding: 0rpx 30rpx 0rpx 34rpx;
		background-size: 100% auto !important;
	}

	.myMoney_fd3_1_c1_c0_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 700;
	}

	.myMoney_fd3_1_c1_c0_c0 {
		margin: 0rpx 8rpx 0rpx 0rpx;
		color: #999999;
		font-size: 28rpx;
		font-weight: 700;
		line-height: 32rpx;
	}

	.myMoney_fd3_1_c1_c0 {
		line-height: 39rpx;
		font-size: 32rpx;
		font-weight: 700;
		color: rgba(254, 59, 48, 1);
	}

	.myMoney_fd3_1_c0_c1 {
		margin: 16rpx 0rpx 0rpx 0rpx;
		line-height: 32rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
	}

	.myMoney_fd3_1_c0_c0 {
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		line-height: 42rpx;
		font-size: 28rpx;
		font-weight: 500;
		color: #333333;
	}

	.myMoney_fd3_1_c0 {
		margin: 0rpx 32rpx 0rpx 0rpx;
	}

	.myMoney_fd3_1 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.myMoney_fd3_0_c1_c0_c1 {
		color: #E5393C;
		font-size: 32rpx;
		font-weight: 700;
	}

	.myMoney_fd3_0_c1_c0_c0 {
		margin: 0rpx 8rpx 0rpx 0rpx;
		color: #E5393C;
		font-size: 32rpx;
		font-weight: 700;
	}

	.myMoney_fd3_0_c1_c0 {
		line-height: 39rpx;
		font-size: 32rpx;
		font-weight: 700;
		color: #333333;
	}

	.myMoney_fd3_0_c0_c1 {
		margin: 16rpx 0rpx 0rpx 0rpx;
		line-height: 32rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
	}

	.myMoney_fd3_0_c0_c0 {
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		line-height: 42rpx;
		font-size: 28rpx;
		font-weight: 500;
		color: #333333;
	}

	.myMoney_fd3_0_c0 {
		margin: 0rpx 32rpx 0rpx 0rpx;
	}

	.myMoney_fd3_0 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.myMoney_flex_4 {
		width: 540rpx;
	}

	.myMoney_fd4_1_c0 {
		width: 55rpx;
		height: 55rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.myMoney_fd4_1 {
		margin: 40rpx 0rpx 0rpx 0rpx;
	}

	.myMoney_fd4_0_c1_c0 {
		line-height: 48rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
	}

	.myMoney_fd4_0_c0_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.myMoney_fd4_0_c0 {
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.myMoney_fd4_0 {
		background: #FFFFFF;
		background-size: 100% !important;
		background-size: 100% auto !important;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		padding: 32rpx 32rpx 32rpx 32rpx;
	}
</style>